public class DefaultAlarmWriter extends java.lang.Object implements AlarmWriter
DefaultAlarmWriter
implementation of the AlarmWriter interface. DefaultAlarmWriter
maintains a queue of a fixed size to which the alarms are
written. The sending of the alarms to the alarm service takes place on a seperate thread. The
queue is fixed size.Constructor and Description |
---|
DefaultAlarmWriter(int port,
java.lang.String alarmServiceName)
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and a
queue size of fifty (50).
|
DefaultAlarmWriter(int port,
java.lang.String alarmServiceName,
int queueSize)
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue
size.
|
DefaultAlarmWriter(int port,
java.lang.String alarmServiceName,
int queueSize,
ConditionalTrace debugTrace_,
UnconditionalTrace errorTrace_)
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue
size.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shutdown the send thread and close the socket
|
java.lang.String |
getDescription() |
boolean |
getEnabled() |
java.lang.String |
getName() |
static void |
main(java.lang.String[] args) |
void |
send(java.lang.String alarmMessage)
send the Alarm to the alarm service
|
void |
setEnabled(boolean enable)
Applications can dynamically enable or disable the AlarmWriter
|
public DefaultAlarmWriter(int port, java.lang.String alarmServiceName, int queueSize) throws java.net.UnknownHostException
port
- port on which the alarm service is listeningalarmServiceName
- The host name of the machine with the Alarm servicequeueSize
- the size of the queue to be maintained in the alarm writerjava.net.UnknownHostException
public DefaultAlarmWriter(int port, java.lang.String alarmServiceName) throws java.net.UnknownHostException
port
- port on which the alarm service is listeningalarmServiceName
- The host name of the machine with the Alarm servicejava.net.UnknownHostException
public DefaultAlarmWriter(int port, java.lang.String alarmServiceName, int queueSize, ConditionalTrace debugTrace_, UnconditionalTrace errorTrace_) throws java.net.UnknownHostException
port
- port on which the alarm service is listeningalarmServiceName
- The host name of the machine with the Alarm servicequeueSize
- the size of the queue to be maintained in the alarm writerjava.net.UnknownHostException
public void send(java.lang.String alarmMessage)
send
in interface AlarmWriter
alarmMessage
- The Alarm to be sentpublic void close()
close
in interface AlarmWriter
public java.lang.String getName()
getName
in interface AlarmWriter
public java.lang.String getDescription()
getDescription
in interface AlarmWriter
public boolean getEnabled()
getEnabled
in interface AlarmWriter
public void setEnabled(boolean enable)
setEnabled
in interface AlarmWriter
enable
- Enable or disable the AlarmWriterpublic static void main(java.lang.String[] args)